package kr.hkit.myframework.uicomp;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import java.awt.GridLayout;
import java.awt.BorderLayout;
import javax.swing.SwingConstants;

public class Emp_InputPanel extends JPanel {
	private JPanel panel;
	private JLabel lbl;
	private JComboBox comboBox;
	/**
	 * Create the panel.
	 */
	public Emp_InputPanel() {

		initialize();
	}
	
	public Emp_InputPanel(String lblStr) {

		initialize();
		lbl.setText(lblStr);
	}
	private void initialize() {
		setLayout(new BorderLayout(0, 0));
		
		panel = new JPanel();
		add(panel);
		panel.setLayout(new GridLayout(0, 2, 0, 0));
		
		lbl = new JLabel("New label");
		lbl.setHorizontalAlignment(SwingConstants.CENTER);
		panel.add(lbl);
		
		comboBox = new JComboBox();
		panel.add(comboBox);
	}
	
	public String getSelectItem(){
		return (String) comboBox.getSelectedItem();
	}
	
	public void setSelctItem(String str){
		comboBox.setSelectedItem(str);
	}
	
	public void setDefaultSelectIndex(int index){
		comboBox.setSelectedIndex(index);
	}
	
	public void addItems(String...lists){
		for(String item:lists){
			comboBox.addItem(item);
		}
	}
	
	public JComboBox<Object> getCmb() {
		return comboBox;
	}

}
